<!DOCTYPE html>
<html lang="zh-cn">


<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1.0, user-scalable=no">
  <meta name="theme-color" content="#202020"/>
  <meta http-equiv="x-ua-compatible" content="ie=edge">
  
  
    <meta name="keywords" content="" />
  

  
    <meta name="description" content="我在时间的长河中流浪，寻找一个有你的地方" />
  
  
  
    <link rel="icon" type="image/x-icon" href="https://cdn.jsdelivr.net/gh/haige2486/CDN@1.0/images/favicon.ico">
  
  <title>search [ 海哥のBlog ]</title>
  
    <!-- stylesheets list from config.yml -->
    
      <link rel="stylesheet" href="//cdn.bootcss.com/pure/1.0.0/pure-min.css">
    
      <link rel="stylesheet" href="/css/xoxo.css">
    
      <link rel="stylesheet" href="/css/keyframe.css">
    
  
  <script src="https://cdn.jsdelivr.net/npm/pjax/pjax.js"></script>
  <script async src="https://busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script>
<meta name="generator" content="Hexo 4.2.0"></head>

<body>
  <div class="nav-container">
    <nav class="home-menu pure-menu pure-menu-horizontal">
  <a class="pure-menu-heading" href="/">
    
      <img class="avatar" src="https://cdn.jsdelivr.net/gh/haige2486/CDN@1.0/images/custom/avatar.png">
    
    <span class="title">海哥のBlog</span>
  </a>

  <ul class="pure-menu-list clearfix">
      
          
            <li class="pure-menu-item"><a href="/" class="pure-menu-link">首页</a></li>
          
      
          
            <li class="pure-menu-item"><a href="/archives" class="pure-menu-link">归档</a></li>
          
      
          
            <li class="pure-menu-item"><a href="/tags" class="pure-menu-link">标签</a></li>
          
      
          
            <li class="pure-menu-item"><a href="/categories" class="pure-menu-link">分类</a></li>
          
      
          
            <li class="pure-menu-item actived"><a href="/search" class="pure-menu-link">搜索</a></li>
          
      
  </ul>
   
</nav>
  </div>

  <div class="container" id="content-outer">
    <div class="inner" id="content-inner">
      <article class="post page" id="page">
  <header class="post-header text-center">
  </header>
  <div class="post-content">
    
        <div class="search-content">
  <form class="pure-form">
    <input type="text" id="local-search-input" name="q" results="0" autocomplete="off" placeholder="搜索"
      class="pure-input pure-input-1" />
  </form>
  <div id="local-search-result"></div>
</div>
<script src="//cdn.bootcss.com/zepto/1.2.0/zepto.min.js"></script>
<script>
  var searchFunc = function (path, search_id, content_id) {
    'use strict';
    $.ajax({
      url: path,
      dataType: "xml",
      success: function (xmlResponse) {
        // get the contents from search data
        var datas = $("entry", xmlResponse).map(function () {
          return {
            title: $("title", this).text(),
            content: $("content", this).text(),
            url: $("url", this).text()
          };
        }).get();
        var $input = document.getElementById(search_id);
        if (!$input) return;
        var $resultContent = document.getElementById(content_id);
        $input.addEventListener('input', function () {
          var str = '<ul class=\"search-result-list\">';
          var keywords = this.value.trim().toLowerCase().split(/[\s\-]+/);
          $resultContent.innerHTML = "";
          if (this.value.trim().length <= 0) {
            return;
          }
          // perform local searching
          datas.forEach(function (data) {
            var isMatch = true;
            var content_index = [];
            if (!data.title || data.title.trim() === '') {
              data.title = "Untitled";
            }
            var data_title = data.title.trim().toLowerCase();
            var data_content = data.content.trim().replace(/<[^>]+>/g, "").toLowerCase();
            var data_url = data.url;
            var index_title = -1;
            var index_content = -1;
            var first_occur = -1;
            // only match artiles with not empty contents
            if (data_content !== '') {
              keywords.forEach(function (keyword, i) {
                index_title = data_title.indexOf(keyword);
                index_content = data_content.indexOf(keyword);
                if (index_title < 0 && index_content < 0) {
                  isMatch = false;
                } else {
                  if (index_content < 0) {
                    index_content = 0;
                  }
                  if (i == 0) {
                    first_occur = index_content;
                  }
                  // content_index.push({index_content:index_content, keyword_len:keyword_len});
                }
              });
            } else {
              isMatch = false;
            }
            // show search results
            if (isMatch) {
              str += "<li><a href='" + data_url + "' class='search-result-title'>" + data_title + "</a>";
              var content = data.content.trim().replace(/<[^>]+>/g, "");
              if (first_occur >= 0) {
                // cut out 100 characters
                var start = first_occur - 20;
                var end = first_occur + 80;
                if (start < 0) {
                  start = 0;
                }
                if (start == 0) {
                  end = 100;
                }
                if (end > content.length) {
                  end = content.length;
                }
                var match_content = content.substr(start, end);
                // highlight all keywords
                keywords.forEach(function (keyword) {
                  var regS = new RegExp(keyword, "gi");
                  match_content = match_content.replace(regS, "<em class=\"search-keyword\">" + keyword + "</em>");
                });
                str += "<p class=\"search-result\">" + match_content + "...</p>"
              }
              str += "</li>";
            }
          });
          str += "</ul>";
          $resultContent.innerHTML = str;
        });
      }
    });
  };
  var search_path = "search.xml";
  if (search_path.length == 0) {
    search_path = "search.xml";
  }
  var path = "/" + search_path;
  var inputArea = document.querySelector("#local-search-input");
  inputArea.onclick = function () {
    searchFunc(path, 'local-search-input', 'local-search-result');
  }
</script>
      
  </div>
</article>
    </div>

    
    <div id="toTop">^</div>
  </div>
  <footer class="footer text-center">
    <div id="bottom-inner">
        <a class="bottom-item" href="https://lustghost.gitee.io">首页</a> |
        <a class="bottom-item" href="https://github.com/haige2486" target="_blank">GitHub</a> |
        <a class="bottom-item" href="https://hexo.io" target="_blank">Powered by hexo</a>
    </div>
</footer>
  

<script>
  var pjax = new Pjax({
    elements: "a",
    selectors: [".inner"]
  });

  document.addEventListener('visibilitychange', function () {
    if (document.visibilityState == 'hidden') {
      normal_title = document.title;
      document.title = 'დ待゜人归ꦿ໊ོﻬ࿐ོ';
    } else document.title = normal_title;
  });

  function rt() {
    var d = document,
      dd = document.documentElement,
      db = document.body,
      top = dd.scrollTop || db.scrollTop,
      step = Math.floor(top / 20);
    (function () {
      top -= step;
      if (top > -step) {
        dd.scrollTop == 0 ? db.scrollTop = top : dd.scrollTop = top;
        setTimeout(arguments.callee, 20);
      }
    })();
  }
  document.getElementById("toTop").addEventListener("click", rt);
  document.addEventListener("scroll", function () {
    var dd = document.documentElement,
      db = document.body,
      top = dd.scrollTop || db.scrollTop
    if (top > (window.innerHeight*0.7)) {
      document.getElementById("toTop").style.display = "block";
      document.getElementsByClassName("nav-container")[0].style.display = "none";
    } else {
      document.getElementById("toTop").style.display = "none";
    }
    if(top<50){
      document.getElementsByClassName("nav-container")[0].style.display = "block";
    }
  })
</script>
  



  <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/aplayer/dist/APlayer.min.css">
<script src="https://cdn.jsdelivr.net/npm/aplayer/dist/APlayer.min.js"></script>
<!-- require MetingJS -->
<script src="https://cdn.jsdelivr.net/npm/meting@2/dist/Meting.min.js"></script>
<meting-js  id="2660651585"  server="netease"  type="playlist"  fixed="true"  autoplay="false"  loop="all"  order="random"  preload="auto"  volume="0.7"  mutex="true"  </meting-js>
    <style id="rewrite">
        .aplayer.aplayer-fixed{
            width: 70%;
        }
        .aplayer-body{
            width: 80% !important;
        }
        .aplayer.aplayer-narrow .aplayer-body {
            left: -66px !important;
        }
        .aplayer.aplayer-fixed .lrc-show {
            display: block;
            background: rgba(255, 255, 255, 0.8);
        }
        .aplayer-lrc-current{
            animation: shake-it .5s reverse infinite cubic-bezier(0.68, -0.55, 0.27, 1.55);
        }
    </style>
    <script>
        typeof document.getElementsByClassName("aplayer")[0] !== "undefined" && document.getElementsByClassName("aplayer")[0].addEventListener("click", function () {
            if (document.getElementsByClassName("aplayer-button")[0].hasClass('aplayer-play')) {
                document.getElementsByClassName('aplayer-lrc')[0].removeClass('lrc-show');
            } else {
                document.getElementsByClassName('aplayer-lrc')[0].addClass('lrc-show');
            }
        })
    </script>
</body>
</html>
